package com.winai.launcher.override.popup;

import android.content.Context;
import android.content.Intent;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.lxj.xpopup.core.PositionPopupView;
import com.lxj.xpopup.util.XPopupUtils;
import com.winai.launcher.R;
import com.winai.launcher.utils.BaseUtils;
import com.winai.launcher.view.set.SetWifiActivity;

public class TipMsgPopup extends PositionPopupView {
    private Context mContext;

    public TipMsgPopup(@NonNull Context context) {
        super(context);
        mContext = context;
        TextView tvGoto = findViewById(R.id.tv_goto);
        BaseUtils.setTextGradient(tvGoto);
        tvGoto.setOnClickListener(v -> {
            Intent intent = new Intent(context, SetWifiActivity.class);
            intent.putExtra("titleName", "无线网络");
            context.startActivity(intent);
        });
    }

    @Override
    protected int getImplLayoutId() {
        return R.layout.popup_tip_msg;
    }

    @Override
    protected int getMaxWidth() {
        return XPopupUtils.getWindowWidth(mContext);
    }
}
